package test;

import org.junit.Test;

import java.sql.SQLOutput;
import java.util.concurrent.Callable;

/**
 * @Author duWenJian
 * @Date 2024/2/18 17:47
 * @Version 1.0
 */
public class MyCompletableFuture{

    public static void main(String[] args) throws InterruptedException {
        Integer[] mount = new Integer[8];
        Thread thread = new Thread(() -> {
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            int a = 8;
            mount[0] = a;
        }, "input");
        thread.start();
        thread.join();

        Integer integer = mount[0];
        System.out.println(integer);

    }


    static class MyThread extends Thread{
        @Override
        public void run() {
            System.out.println("你好");
        }
    }

    static class MyThread01 implements Runnable {
        @Override
        public void run() {
            System.out.println("runnable");
        }
    }

    static class MyThread02 implements Callable<String>{
        @Override
        public String call() throws Exception {
            return null;
        }
    }

    @Test
    public void test(){
        String a1 = "hello";
        String a2 = new String("hello");

        String a3 = "h";
        String a4 = "ello";
        // ×  ×  ×
        System.out.println(a1 == a2);
        System.out.println(a1 == (a3+a4));
        System.out.println(a2 == (a3+a4));
    }
}
